package persistence;

/**
 * @author idan
 */
public interface PersistenceFactory
{
	/**
	 * @return 'true' if the persistence loads from an existing database, 'false' if creates a fresh one.
	 */
	boolean loadingFromExisting() ;

	/**
	 * @return a new persistence controller for directories.
	 * @throws CorruptDataException if the database did not contain the expected information.
	 */
	PersistenceController newDirecoryPersistence() throws CorruptDataException ;

	/**
	 * @return a new persistence controller for logins.
	 * @throws CorruptDataException if the database did not contain the expected information.
	 */
	PersistenceController newLoginPersistence() throws CorruptDataException ;

	/**
	 * @return a new persistence controller for members.
	 * @throws CorruptDataException if the database did not contain the expected information.
	 */
	PersistenceController newMemberPersistence() throws CorruptDataException ;

	/**
	 * @return a new persistence controller for posts.
	 * @throws CorruptDataException if the database did not contain the expected information.
	 */
	PersistenceController newPostPersistence() throws CorruptDataException ;

	/**
	 * @return a new persistence controller for threads.
	 * @throws CorruptDataException if the database did not contain the expected information.
	 */
	PersistenceController newThreadPersistence() throws CorruptDataException ;
}
